<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./resrt.css">
    <style>
        #app{
            width: 500px;
            margin: 100px auto;
            padding: 20px;
            box-sizing: border-box;
        }
        h1{
            font-size: 30px;
        }
        input{
            line-height: 50px;
            width: 100%;
            box-sizing: border-box;
            padding-left: 20px;
            border: 1px solid #eee;
            margin-top: 40px;
        }
        button{
            line-height: 50px;
            width: 100%;
            margin-top: 40px;
            margin-bottom: 40px;
        }
    </style>
</head>
<body>
    <div id="app">
        <h1>密码登录</h1>
        <input type="text" placeholder="手机" v-model="from.phone">
        <input type="text" placeholder="密码" v-model="from.pass">
        <button @click="add">登录</button>

        <h1 v-text> {{list.phone}} </h1>
        <h1 v-text> {{list.pass}} </h1>
    </div>
</body>
</html>
<script src="./vue-2.5.21.js"></script>
<script>
    var v = new Vue({
        el:'#app',
        data:{
            from:{ phone : '' , pass : '' },
            list : { phone : '' , pass : '' }
        },
        methods:{
            add(){
                this.list.phone = this.from.phone
                this.list.pass = this.from.pass
            }
        }
    })
</script>